package cn.com.miao.lynx.service.system.entity;

import cn.com.miao.lynx.common.base.model.TreeModel;
import lombok.*;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * SysDictItem
 * 字典实体
 * @title: SysDictItem
 * @description:
 * @author: dengmiao
 * @create: 2019-12-30 09:53
 **/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = SysDictItem.TABLE_NAME)
@SQLDelete(sql = SysDictItem.LOGIC_DELETE_STATEMENT)
@Where(clause = "del_status = " + SysDictItem.DELETE_FLAG_NORMAL)
public class SysDictItem extends TreeModel<SysDictItem, Long> {

    public final static String TABLE_NAME = "sys_dict_item";

    public final static String LOGIC_DELETE_STATEMENT = "update " + TABLE_NAME + " set del_status = " + SysDictItem.DELETE_FLAG_DELETE + " where id = ?";

    /**
     * 字典id
     */
    private Long dictId;

    /**
     * 字典项文本
     */
    private String itemText;

    /**
     * 字典项值
     */
    private String itemValue;

    /**
     * 描述
     */
    private String description;

    /**
     * 排序
     */
    private Integer sortOrder;
}
